{% extends 'base.html' %}
{% block title %}恢复数据库{% endblock %}
{% block content %}

<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>恢复数据库</title>
</head>
<body>
    <h1>恢复数据库</h1>
    <p style="color: red;">警告：恢复操作可能会覆盖现有数据，请确保已备份当前数据库！</p>
    {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
            {% for category, message in messages %}
                <p style="color: {{ 'green' if category == 'success' else 'red' }};">{{ message }}</p>
            {% endfor %}
        {% endif %}
    {% endwith %}
    <form method="POST" enctype="multipart/form-data">
        <label for="file">选择 SQL 文件:</label>
        <input type="file" id="file" name="file" accept=".sql" required>
        <button type="submit">恢复</button>
    </form>
    <p><a href="{{ url_for('index') }}">返回主页</a></p>
</body>
</html>

{% endblock %}